﻿using System;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.AuthorCenter.Users
{
    public class UserDataPermission : AggregateRoot<Guid>, IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid UserId { get; private set; }

        /// <summary>
        /// 查看所属部门数据
        /// </summary>
        public bool IsOwnDepartment { get; private set; }

        /// <summary>
        /// 查看自己创建数据
        /// </summary>
        public bool IsOwnCreated { get; private set; }

        private UserDataPermission() { }

        public UserDataPermission(Guid id , Guid userId , bool isOwnDepartment, bool isOwnCreated)
        {
            Id = id;
            UserId = userId;
            IsOwnCreated = isOwnCreated;
            IsOwnDepartment = isOwnDepartment;
        }

        public void Change(bool isOwnDepartment, bool isOwnCreated)
        {
            IsOwnDepartment = isOwnDepartment;
            IsOwnCreated = isOwnCreated;
        }
    }
}
